﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MVC_Filter.Infrastructure;

namespace MVC_Filter.Controllers
{
    public class HomeController : Controller
    {
        [CustomAuth(true)]
        public string Index()
        {
            return "This is Index of test attribute";
        }
        [Authorize(Users = "jack")]
        public string List()
        {
            
            return "this is List of test attribute";
        }
        [HandleError(ExceptionType = typeof(ArgumentOutOfRangeException),View = "RangeError")]
        public string Range(int id)
        {
            if (id>10)
            {
                return "The num is  true";
            }
            else
            {
                throw new ArgumentOutOfRangeException("id",id,"");
            }
        }
        [ProfileAction]
        [ProfileResult]
        public string TimeRun()
        {
            return "<br>end run";
        }

        [ProfileAll]
        public string AllFilter()
        {
            return "action start</br>";
        }
    }
}